<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{padding:0; margin:0;}
#nav{width:60%; margin:0 auto; position:relative}
#nav ul li{width:70px; height:40px; float:left; font-weight:bold; text-align:center; line-height:40px;  list-style:none; margin-right:10px; cursor:pointer}
#nav .orange{width:70px; height:40px; background:orange; position:absolute; left:0px; top:0px; z-index:-10; border-radius:20px;}
</style>
<script src="jquery-1.11.0.js"></script>
<script>
$(function(){
		$('#nav li').hover(function(){
				var x=$(this).index();
				var num=(x-1)*80;
				$('.orange').stop().animate({
						marginLeft:num+'px',
					},500)
			},function(){
				$('.orange').stop().animate({
						marginLeft:0
					},500)				
				})
	})
</script>
</head>

<body>
<div id="nav">
	<ul>
    	<div class="orange"></div>
    	<li>文件</li>
    	<li>文件</li>
    	<li>文件</li>
    	<li>文件</li>
    	<li>文件</li>
    </ul>
</div>
</body>
</html>
